//
//  FTextInput.swift
//  takeaway
//
//  Created by zhuxietong on 2021/2/21.
//

import Foundation

open class FTextInput: FText {
    open override func willLayoutRules() {
        super.willLayoutRules()
        textField.delegate = self
        bk.bsui.background(color: ._tableBackground).set(radius: 3, width: 1, color: UIColor._separator.alpha(0.3))
    }
    let bk = ASDisplayNode()
    open override func didLoadProps() {
        textField.text = "\(value)"
        lableNode.attributedText = _lable
        textField.font = valueStyle.font
        textField.textColor = valueStyle.color
        textField.attributedPlaceholder = placeholder.ui.font(font: placeHolderStyle.font).color(color: placeHolderStyle.color).left.astring
    }
    
    open override func specGetter() -> _Spec {
        return .stack(["v|8",&-.stretch,_nowrap], childs: [
            lableNode.Spec,
            _Spec.inset([], [3,8], child: node["28"]).addBack(bk.Spec)
//            node["36"]
        ])
    }
}
